package com.wjpeng.wms.query;

import com.wjpeng.wms.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter @Setter
public class SaleChartQueryObject extends  QueryObject {
    public SaleChartQueryObject() {
        setPageSize(20);
    }
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    private String keyword;
    private Long clientId = -1L;
    private Long brandId = -1L;
    private String groupType = "saleman.name";

    public String getKeyword() {
        return empty2Null(keyword);
    }

    public Date getEndDate(){
        return DateUtil.getEndDate(endDate);
    }

}
